package com.huobao.yunying.adapters;

import com.huobao.yunying.activitys_hehuoren.Act_Gonghuoshang_detail;
import com.huobao.yunying.entity.GonghuoshangList;
import com.huobao.zhangying.R;

import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.view.View.OnClickListener;
import joanzapata.android.BaseAdapterHelper;
import joanzapata.android.QuickAdapter;

public class Adapter_Gonghuoshang_List extends QuickAdapter<GonghuoshangList> {

	public Adapter_Gonghuoshang_List(Context context) {
		super(context, R.layout.item_gonghuoshang_list);
	}

	@Override
	protected void convert(BaseAdapterHelper helper, final GonghuoshangList data) {
		helper.setText(R.id.tv_name, data.store_name).setText(R.id.tv_tel, data.state == 1 ? "开启" : "关闭")
				.setOnClickListener(R.id.tv_detail, new OnClickListener() {

					@Override
					public void onClick(View v) {
						Intent intent = new Intent(context, Act_Gonghuoshang_detail.class);
						intent.putExtra("store_id", data.store_id);
						context.startActivity(intent);
					}
				});
	}

	@Override
	public boolean isEnabled(int position) {
		return false;
	}

}
